Video signals, including analog and digital video signals, have active video intervals (that determine horizontal lines of video) that alternate with horizontal and vertical blanking intervals. Each active video interval determines the pixels of a complete (or partial) horizontal line of pixels. Each horizontal blanking interval includes a horizontal synchronization (HSYNC) pulse. Each vertical blanking interval includes at least one vertical synchronization (VSYNC) pulse and typically also other data structures or signals.
Video signals (to be referred to as “progressive” video signals) for display by progressive scan display devices comprise sequences of frames. Each frame consists of a vertical blanking interval (including at least one VSYNC pulse) followed by N horizontal lines, where N is an integer. Each horizontal line comprises a horizontal blanking interval (including an HSYNC pulse) followed by active video. The duration of each vertical blanking interval is typically equal to M horizontal line periods (where M is an integer greater than or equal to 1). A typical vertical blanking interval includes M portions (each having duration equal to a horizontal line period), with one of these periods including a VSYNC pulse, and each of the other periods including an HSYNC pulse. A progressive raster-scan display device produces an image in response to each frame of a progressive video signal by filling in a sequence of N horizontal bands on a screen (from top to bottom), each band consisting of pixels determined by a different one of the N horizontal lines. The display device resets in response to the VSYNC pulse (or set of VSYNC pulses) in each vertical blanking interval, so that it is ready to produce another image in response to the next N horizontal lines containing active video.
Video signals (to be referred to as “interlaced” video signals) for display by interlaced scan display devices also comprise sequences of frames, but each frame consists of two fields: a top field and a bottom field. Each of the top fields comprises a vertical blanking interval (including at least one VSYNC pulse) followed by L horizontal lines, where L is a number (not necessarily an integer). Each of the bottom fields comprises a vertical blanking interval (including at least one VSYNC pulse) followed by L horizontal lines. Each horizontal line comprises a horizontal blanking interval (including an HSYNC pulse) followed by active video. The duration of each vertical blanking interval is typically equal to M horizontal line periods (where M is an integer greater than or equal to one), and a typical vertical blanking interval includes M portions (each having duration equal to a horizontal line period), with one of these periods including a VSYNC pulse (or VSYNC pulse train) and each of the other periods including an HSYNC pulse. An interlaced raster-scan display device produces an image on a screen (that can be thought of as comprising horizontal bands, numbered consecutively from top to bottom of the screen and thus including odd-numbered and even-numbered bands) in response to each frame of an interlaced video signal by filling in (at least partially) each of a sequence of L odd-numbered horizontal bands (from the top to the bottom of the screen), each odd-numbered band consisting of pixels determined by a different one of the horizontal lines of the top field, and then filling in (at least partially) each of a sequence of L even-numbered horizontal bands (from the top to the bottom of the screen), each even-numbered band consisting of pixels determined by a different one of the horizontal lines of the bottom field. The display device resets in response to the VSYNC pulse (or VSYNC pulses) in each vertical blanking interval, in the sense that it prepares to fill in even-numbered (or odd-numbered) bands of the screen in response to the next L horizontal lines containing active video.
One commonly used type of video game system asserts a video (typically analog video) signal to a TV monitor (or other display device) for display. Such a game system includes a CPU, graphics processing circuitry for generating frames of image data under control of the CPU, and a TV encoder for generating a video signal in response to the image data. The display device is coupled to receive and display the video signal generated by the TV encoder. The image data is clocked out of the graphics processing circuitry (to the TV encoder) in response to a pixel clock. While executing a game program (defined by commands stored in memory accessible by the CPU), the CPU processes input data from an input device (sometimes referred to as a game controller). During the game, a player manipulates the input device (e.g., a light gun) to point to locations on the screen of the display device, while the display device displays video on the screen.
One of the functions implemented by the CPU (referred to herein as a “pointing device function”) is to determine the specific pixel or group of pixels (of the video frame being displayed) to which the input device points. Conventionally, in order to perform the pointing device function, the CPU (or circuitry coupled thereto) must have access to the video baseband signal sent to the display device (in order to extract the HSYNC and VSYNC pulses therefrom), or to a composite sync signal that has been generated from the video baseband signal or a composite sync signal that has been generated from the clock employed to generate the video baseband signal.
For example, in one conventional game system in which the input device is a light gun, the CPU (or circuitry coupled thereto) receives light intensity data (from a photodiode or other sensor in the light gun) and control data indicating whether the user is pulling the gun trigger. In response to control data indicating that the user has pulled the trigger, the CPU resets logic circuitry in the gun, and causes the screen to display a black image and then a white image. In response to light intensity data received from the gun during the sequential display of the black and white images, the CPU determines the specific pixel or group of pixels to which the gun is pointing. In order to make this determination, the CPU must know the time at which the first white pixel sensed by the gun is displayed relative to the assertion times of the HSYNC and VSYNC pulses of the displayed video signal. Typically, the gun captures a delay value (indicative of this relative time) from a counter, and the gun sends the delay value to the CPU so that the CPU can make the noted determination. In order for the gun to capture the delay value, sync stripping circuitry in (or coupled to) the gun extracts the HSYNC and VSYNC pulses from the video baseband signal sent to the display device, and the extracted HSYNC and VSYNC pulses are used to capture the delay value. However, because of the complexity of the data structures in the horizontal and vertical blanking intervals of the video baseband signal, complex circuitry is needed to extract the HSYNC and VSYNC pulses from the video baseband signal.
Until the present invention, it bad not been known how to synthesize a composite sync signal indicative of the timing information required to implement a pointing device function in a video game system (or other system), using simple circuitry and without the need to use the video baseband signal output by the system (or corresponding to the system's video output) or the clock employed to generate such video baseband signal. Nor had it been known how to synthesize a composite sync signal whose timing accurately matches that of the horizontal and vertical sync pulses of a video baseband signal, using simple circuitry, without the need to use the clock employed to generate the video baseband signal itself, and without the need to use a clock whose frequency Fo satisfies Fo=MFp or Fo=Fp/M, where M is an integer and Fp is the rate at which pixels of the video baseband signal are asserted to the display device.
The invention employs the Bresenham algorithm to generate a synthetic sync pulse train using simple circuitry. The Bresenham algorithm has been widely used in graphics processing systems to draw approximations of lines (having arbitrary slope) using pixels of a video signal, but it has not to the inventors' knowledge been used to generate synthetic sync pulses as in the present invention.